// app.js
const route = require('./common/utils/navUtils.js')
const cache = require('./common/utils/cache.js')
const toast = require('./common/utils/toast.js')
const Time = require('./common/utils/timeutil.js')
const checkData = require('./common/utils/check.js')
App({
  onLaunch: function () {
    if (!wx.cloud) {
      console.error('请使用 2.2.3 或以上的基础库以使用云能力');
    } else {
      wx.cloud.init({
        env: 'carlson-yun-6gsfgex5f4754200',
        traceUser: true,
      });

    }

    this.globalData = {
      //用户信息
      userInfo: null
    };
    wx.getSystemInfo({
      success: e => {
        console.log(e);
        this.globalData.StatusBar = e.statusBarHeight;
        let custom = wx.getMenuButtonBoundingClientRect();
        this.globalData.Custom = custom;
        this.globalData.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
        this.globalData.windowHeight = e.safeArea.height;
        this.globalData.windowWidth = e.safeArea.width
      }
    })
    // 查看同步存储存了多少
    wx.getStorageInfo({
      success(res) {
        console.log('所有的 key:', res.keys)
        console.log('当前占用的空间大小:', res.currentSize + ' KB')
        console.log('目前可用空间:', res.limitSize + ' KB')
      }
    })
  },


  route,
  cache,
  toast,
  Time,
  checkData,
});